package naruto.common;

import java.util.Vector;

/**
 *
 * @author nacuong
 */
public class GraphCommon {
  public static enum EdgeAttribute {TRUE, FALSE, NONE}
  public static enum EdgeStatus {CONCRETE, ABSTRACT}

  public static Vector<String> getPrefixMethodList(Vector<String> methodCallList){
    Vector<String> prefixMethodList = new Vector<String>();
    for (String method: methodCallList)
      if (!containsPrefix(prefixMethodList, method))
        prefixMethodList.add(method);

    return prefixMethodList;
  }

  private static boolean containsPrefix(Vector<String> vector, String string){
    for (String element: vector)
      if (element.contains(string))
        return true;

    return false;
  }
}
